import { stringify } from 'qs';
import request from '@/utils/request';
import { getPageSize } from '@/utils/common';

export async function selectAll(params) {
  return request(`/server/api/tms/tms-etc-change/generateBillByCheckAll`, {
    method: 'POST',
    body: params,
  });
}

//一、ETC卡管理
//ETC卡管理查询列表
export async function ETCList(params) {
  params.pageSize = params.pageSize || getPageSize();
  return request(`/server/api/tms/tms-etc/selectList`, {
    method: 'POST',
    body: params,
  });
}
///ETC卡管理新增
export async function etcCardAdd(params) {
  return request(
    `/server/api/tms/tms-etc/insertTmsEtcCard`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}
//ETC卡管理编辑
export async function etcCardEdit(params) {
  return request(
    `/server/api/tms/tms-etc/upadteTmsEtcCard`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}

//ETC卡管理详情
export async function etcDetails(params) {
  return request(
    `/server/api/tms/tms-etc/viewDetails`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}
//ETC卡管理禁用
export async function disabledTmsEtcCard(params) {
  return request(
    `/server/api/tms/tms-etc/disabledTmsEtcCard`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}
//ETC卡管理启用
export async function enableTmsEtcCard(params) {
  return request(
    `/server/api/tms/tms-etc/enableTmsEtcCard`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}
//ETC卡管理充值
export async function rechange(params) {
  return request(
    `/server/api/tms/tms-etc-change/etcRecharge`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}
//删除ETC记录：
export async function deleteEtc(params) {
  return request(
    `/server/api/tms/tms-etc/deleteTmsEtc`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}

//二、ETC交易记录
export async function etcChangeList(params) {
  params.pageSize = params.pageSize || getPageSize();
  return request(`/server/api/tms/tms-etc-change/selectList`, {
    method: 'POST',
    body: params,
  });
}
export async function etcChangeAdd(params) {
  return request(
    `/server/api/tms/tms-etc-change/insertTmsEtcChange`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}
export async function etcChangeEdit(params) {
  return request(
    `/server/api/tms/tms-etc-change/upadteTmsEtcChange`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}
export async function etcChangetDetails(params) {
  return request(`/server/api/tms/tms-etc-change/viewDetails`, {
    method: 'POST',
    body: params,
  });
}
//导入：
export async function importEtcChange(params) {
  return request(`/server/api/tms/tms-etc-change/importEtcChangeDetail`, {
    method: 'POST',
    body: params,
  });
}

//车辆查询
export async function carList(params) {
  return request(
    `/server/api/tms/tms-oil-card/selectOilVehicle`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}
/**
 * 生成账单
 */
export async function generatedBills(params) {
  return request(`/server/api/tms/tms-etc-change/generateBill`, {
    method: 'POST',
    body: params,
  });
}
